package com.hudilao.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hudilao.entity.SetmealDish;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface SetmealDishMapper extends BaseMapper<SetmealDish> {
    @Insert("<script>" +
            "INSERT INTO setmeal_dish (id,setmeal_id, dish_id, name, price, copies) VALUES " +
            "<foreach collection='list' item='item' separator=','>" +
            "(#{item.id},#{item.setmealId}, #{item.dishId}, #{item.name}, #{item.price}, #{item.copies})" +
            "</foreach>" +
            "</script>")
    void insertBatchSomeColumn(@Param("list") List<SetmealDish> setmealDishes);
}